#include <iostream>
using namespace std;



int main() {
    int n,m;
    cin >> n >> m;
    int score[n],index[n];
    for(int i = 0;i < n;i++) {
        cin >> index[i] >> score[i];
    }

    // 对选手成绩进行排序
    for(int i = 0;i < n;i++) {
        for (int j = 0;j < n - i - 1;j++) {
            if (score[j] < score[j+1]) {
                int tmp = score[j];
                score[j] = score[j+1];
                score[j+1] = tmp;
                int tmp2 = index[j];
                index[j] = index[j+1];
                index[j+1] = tmp2;

                // 如果分数相同，则对选手编号进行排序
            }else if (score[j] == score[j+1]) {
                if (index[j] > index[j+1]) {
                    int tmp = score[j];
                    score[j] = score[j+1];
                    score[j+1] = tmp;
                    int tmp2 = index[j];
                    index[j] = index[j+1];
                    index[j+1] = tmp2;
                }
            }
        }
    }
    // 划定分数线
    int rankLineIndex = (m * 150) / 100 - 1;
    int n_score = score[rankLineIndex];
    int count = 0;

    // 统计通过的选手
    for(int i = 0;i < n;i++) {
        if (score[i] >= n_score) {
            count++;
        }else {
            break;
        }
    }
    cout << n_score << " " << count << endl;

    // 输出通过选手的信息
    for(int i = 0;i < n;i++) {
        if (score[i] >= n_score) {
            cout << index[i] << " " << score[i] << endl;
        }
    }
}